inherited fmAddCommonBN_Agr: TfmAddCommonBN_Agr
  Left = 444
  Top = 130
  Width = 1208
  Height = 709
  Caption = #1044#1086#1073#1072#1074#1080#1090#1100' '#1073#1072#1085#1082#1086#1074#1089#1082#1080#1081' '#1087#1083#1072#1090#1077#1078' '#1082' '#1076#1086#1075#1086#1074#1086#1088#1091
  Constraints.MinHeight = 527
  Constraints.MinWidth = 1208
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited sbBottom: TStatusBar
    Top = 644
    Width = 1192
  end
  inherited Panel1: TPanel
    Width = 1192
    inherited BitBtn1: TBitBtn
      Left = 1017
      Top = 9
    end
    inherited BitBtn2: TBitBtn
      Left = 1105
    end
  end
  object Panel4: TPanel [2]
    Left = 0
    Top = 45
    Width = 1192
    Height = 599
    Align = alClient
    BevelOuter = bvNone
    TabOrder = 2
    DesignSize = (
      1192
      599)
    object Label1: TLabel
      Left = 13
      Top = 246
      Width = 60
      Height = 13
      Caption = #1057#1091#1084#1084#1072', '#1088#1091#1073'.'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label4: TLabel
      Left = 8
      Top = 503
      Width = 152
      Height = 13
      Caption = #1050#1086#1084#1084#1077#1085#1090#1072#1088#1080#1081' '#1082' '#1092#1072#1082#1090#1091' '#1086#1087#1083#1072#1090#1099
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label13: TLabel
      Left = 15
      Top = 392
      Width = 43
      Height = 13
      Caption = #1044#1086#1075#1086#1074#1086#1088
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
      Visible = False
    end
    object Label14: TLabel
      Left = 11
      Top = 447
      Width = 63
      Height = 13
      Caption = #1044#1077#1081#1089#1090#1074#1091#1077#1090' '#1089
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
      Visible = False
    end
    object Label15: TLabel
      Left = 171
      Top = 447
      Width = 70
      Height = 13
      Caption = #1044#1077#1081#1089#1090#1074#1091#1077#1090' '#1087#1086
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
      Visible = False
    end
    object Label16: TLabel
      Left = 331
      Top = 447
      Width = 89
      Height = 13
      Caption = #1044#1072#1090#1072' '#1087#1086#1076#1087#1080#1089#1072#1085#1080#1103
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
      Visible = False
    end
    object Label17: TLabel
      Left = 491
      Top = 447
      Width = 144
      Height = 13
      Caption = #1057#1088#1091#1082#1090#1091#1088#1085#1086#1077' '#1055#1086#1076#1088#1072#1079#1076#1077#1083#1077#1085#1080#1077
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
      Visible = False
    end
    object Label10: TLabel
      Left = 928
      Top = 9
      Width = 186
      Height = 13
      Caption = #1054#1073#1097#1080#1081' '#1073#1072#1083#1083#1072#1085#1089' '#1087#1086' '#1083'/'#1089' '#1087#1086#1083'. '#1091#1089#1083', '#1088#1091#1073'.'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label19: TLabel
      Left = 653
      Top = 447
      Width = 55
      Height = 13
      Caption = #1055#1086#1076#1087#1080#1089#1072#1085#1090
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
      Visible = False
    end
    object DBText1: TDBText
      Left = 160
      Top = 9
      Width = 121
      Height = 17
      DataField = 'BPDATAPOSTUPILO'
      DataSource = DataSourceAllPoruch
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clBlack
      Font.Height = -16
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ParentFont = False
    end
    object Label5: TLabel
      Left = 8
      Top = 12
      Width = 144
      Height = 13
      Caption = #1044#1072#1090#1072' '#1073#1072#1085#1082#1086#1074#1089#1082#1086#1075#1086' '#1087#1083#1072#1090#1077#1078#1072':'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label6: TLabel
      Left = 8
      Top = 34
      Width = 64
      Height = 13
      Caption = #1055#1083#1072#1090#1077#1083#1100#1097#1080#1082
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label7: TLabel
      Left = 8
      Top = 112
      Width = 107
      Height = 13
      Caption = #1053#1072#1079#1085#1072#1095#1077#1085#1080#1077' '#1087#1083#1072#1090#1077#1078#1072
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object DBText7: TDBText
      Left = 752
      Top = 91
      Width = 161
      Height = 17
      DataField = 'BPPLATSCHET'
      DataSource = DataSourceAllPoruch
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -13
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object DBText5: TDBText
      Left = 752
      Top = 71
      Width = 161
      Height = 17
      DataField = 'BPPLATKPP'
      DataSource = DataSourceAllPoruch
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -13
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object DBText4: TDBText
      Left = 752
      Top = 50
      Width = 161
      Height = 17
      DataField = 'BPPLATINN'
      DataSource = DataSourceAllPoruch
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -13
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label8: TLabel
      Left = 720
      Top = 52
      Width = 25
      Height = 13
      Caption = #1048#1053#1053':'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label9: TLabel
      Left = 720
      Top = 73
      Width = 25
      Height = 13
      Caption = #1050#1055#1055':'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label20: TLabel
      Left = 720
      Top = 93
      Width = 29
      Height = 13
      Caption = #1057#1095#1077#1090':'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label21: TLabel
      Left = 9
      Top = 189
      Width = 92
      Height = 13
      Align = alCustom
      Caption = #1055#1086#1083#1091#1095#1072#1090#1077#1083#1100' '#1091#1089#1083#1091#1075
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label2: TLabel
      Left = 179
      Top = 247
      Width = 134
      Height = 13
      Anchors = [akTop, akRight]
      Caption = #1054#1089#1090#1072#1090#1086#1082' '#1086#1090' '#1087#1083#1072#1090#1077#1078#1072', '#1088#1091#1073'.'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label3: TLabel
      Left = 10
      Top = 300
      Width = 58
      Height = 13
      Caption = #1050#1090#1086' '#1087#1083#1072#1090#1080#1090
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object ePAAMOUNT: TcxDBTextEdit
      Left = 10
      Top = 264
      DataBinding.DataField = 'PAAMOUNT'
      DataBinding.DataSource = dsPAgr
      ParentFont = False
      Properties.IncrementalSearch = False
      Properties.OnEditValueChanged = ePAAMOUNTPropertiesEditValueChanged
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -19
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.Shadow = False
      Style.IsFontAssigned = True
      TabOrder = 0
      Width = 143
    end
    object mPANOTE: TcxDBMemo
      Left = 7
      Top = 525
      DataBinding.DataField = 'PANOTE'
      DataBinding.DataSource = dsPAgr
      ParentFont = False
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -16
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.Shadow = False
      Style.TextStyle = [fsBold]
      Style.IsFontAssigned = True
      TabOrder = 1
      OnClick = mPANOTEClick
      Height = 71
      Width = 1178
    end
    object lcbAGRID: TcxDBLookupComboBox
      Left = 12
      Top = 411
      DataBinding.DataField = 'AGRID'
      DataBinding.DataSource = dsPAgr
      ParentFont = False
      Properties.Alignment.Horz = taLeftJustify
      Properties.DropDownRows = 15
      Properties.KeyFieldNames = 'AGID'
      Properties.ListColumns = <
        item
          Caption = #8470' '#1044#1086#1075'.'
          Fixed = True
          MinWidth = 6
          Width = 60
          FieldName = 'AGID'
        end
        item
          Caption = #1044#1072#1090#1072' '#1087#1086#1076#1087#1080#1089'.'
          Fixed = True
          MinWidth = 11
          Width = 120
          FieldName = 'DATA_PODP'
        end
        item
          Caption = #1044#1077#1081#1089#1090#1074#1091#1077#1090' '#1089
          Fixed = True
          MinWidth = 11
          Width = 120
          FieldName = 'AGDATEBEGIN'
        end
        item
          Caption = #1044#1077#1081#1089#1090#1074#1091#1077#1090' '#1087#1086
          Fixed = True
          MinWidth = 11
          Width = 120
          FieldName = 'AGDATEEND'
        end
        item
          Caption = #1055#1086#1076#1088#1072#1079#1076#1077#1083#1077#1085#1080#1077
          Fixed = True
          MinWidth = 15
          Width = 80
          FieldName = 'PODRAZD'
        end
        item
          Caption = #1055#1086#1083#1091#1095'. '#1091#1089#1083'.'
          Fixed = True
          Width = 300
          FieldName = 'P_RECIPIENT'
        end
        item
          Caption = #1055#1086#1076#1087#1080#1089#1072#1085#1090
          Fixed = True
          Width = 300
          FieldName = 'PODP'
        end>
      Properties.ListSource = dsAgr
      Properties.MaxLength = 0
      Properties.OnEditValueChanged = lcbAGRIDPropertiesEditValueChanged
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clBlack
      Style.Font.Height = -15
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.Shadow = False
      Style.IsFontAssigned = True
      TabOrder = 2
      Visible = False
      OnClick = lcbPayerClick
      Width = 1174
    end
    object eAGDATEBEGIN: TcxDBTextEdit
      Left = 10
      Top = 464
      DataBinding.DataField = 'AGDATEBEGIN'
      DataBinding.DataSource = dsAgr
      ParentFont = False
      Properties.IncrementalSearch = False
      Style.Color = clMoneyGreen
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -19
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.Shadow = False
      Style.IsFontAssigned = True
      TabOrder = 3
      Visible = False
      Width = 143
    end
    object eAGDATEEND: TcxDBTextEdit
      Left = 170
      Top = 464
      DataBinding.DataField = 'AGDATEEND'
      DataBinding.DataSource = dsAgr
      ParentFont = False
      Properties.IncrementalSearch = False
      Style.Color = clMoneyGreen
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -19
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.Shadow = False
      Style.IsFontAssigned = True
      TabOrder = 4
      Visible = False
      Width = 143
    end
    object eDATA_PODP: TcxDBTextEdit
      Left = 330
      Top = 464
      DataBinding.DataField = 'DATA_PODP'
      DataBinding.DataSource = dsAgr
      ParentFont = False
      Properties.IncrementalSearch = False
      Style.Color = clMoneyGreen
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -19
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.Shadow = False
      Style.IsFontAssigned = True
      TabOrder = 5
      Visible = False
      Width = 143
    end
    object ePODRAZD: TcxDBTextEdit
      Left = 490
      Top = 464
      DataBinding.DataField = 'PODRAZD'
      DataBinding.DataSource = dsAgr
      ParentFont = False
      Properties.IncrementalSearch = False
      Style.Color = clMoneyGreen
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -19
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.Shadow = False
      Style.IsFontAssigned = True
      TabOrder = 6
      Visible = False
      Width = 143
    end
    object eBalance: TcxTextEdit
      Left = 929
      Top = 26
      TabStop = False
      ParentFont = False
      Properties.ReadOnly = True
      Style.Color = 8421631
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -27
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.Shadow = False
      Style.IsFontAssigned = True
      TabOrder = 7
      Width = 168
    end
    object ePodpisant: TcxDBTextEdit
      Left = 652
      Top = 464
      DataBinding.DataField = 'PODP'
      DataBinding.DataSource = dsAgr
      ParentFont = False
      Properties.IncrementalSearch = False
      Style.Color = clMoneyGreen
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -19
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.Shadow = False
      Style.IsFontAssigned = True
      TabOrder = 8
      Visible = False
      Width = 533
    end
    object cxGroupBox1: TcxGroupBox
      Left = 929
      Top = 80
      Caption = #1055#1086#1080#1089#1082' '#1087#1086' '#1076#1086#1075#1086#1074#1086#1088#1072#1084
      Style.TextColor = clGray
      TabOrder = 9
      Height = 153
      Width = 256
      object rgAgrSearch: TcxRadioGroup
        Left = 8
        Top = 16
        Caption = #1050#1088#1080#1090#1077#1088#1080#1080
        Properties.Columns = 2
        Properties.Items = <
          item
            Caption = #8470' '#1076#1086#1075'.'
            Value = 0
          end
          item
            Caption = #8470' '#1076#1086#1075'. '#1085#1072' '#1076#1086#1082'.'
            Value = 1
          end
          item
            Caption = #1044#1072#1090#1072' '#1076#1086#1075#1086#1074#1086#1088#1072
            Value = 3
          end
          item
            Caption = #1055#1086' '#1085#1086#1074#1086#1084#1091' '#1085#1086#1084#1077#1088#1091
            Value = 4
          end>
        Properties.OnEditValueChanged = rgAgrSearchPropertiesEditValueChanged
        ItemIndex = 1
        Style.TextColor = clBlack
        TabOrder = 0
        Height = 89
        Width = 241
      end
      object cxButton3: TcxButton
        Tag = 12
        Left = 180
        Top = 114
        Width = 30
        Height = 29
        Hint = #1048#1089#1082#1072#1090#1100
        ParentShowHint = False
        ShowHint = True
        TabOrder = 1
        TabStop = False
        OnClick = cxButton3Click
        Glyph.Data = {
          76010000424D7601000000000000760000002800000020000000100000000100
          0400000000000001000000000000000000001000000000000000000000000000
          80000080000000808000800000008000800080800000C0C0C000808080000000
          FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00777777777777
          7777777777777777777777077777777777777787777777777777700077777777
          777778887777777777770F00077777777777878887777777777770F000777777
          77777878887777777777770F00078000877777878887F888F7777770F0008888
          807777787888FFFFF87777770007777778077777888777777F877777707777FF
          F78877777877777777FF777770777777FF707777787777777778777770777777
          7F7077777877777777787777788FF777777077777FF7777777787777788FF777
          777877777FF77777777F777778087777780777777F8F77777F87777777708888
          807777777778FFFFF877777777778000877777777777F888F777}
        LookAndFeel.SkinName = ''
        NumGlyphs = 2
      end
      object eText: TcxMaskEdit
        Left = 46
        Top = 115
        ParentFont = False
        Properties.MaskKind = emkRegExprEx
        Properties.EditMask = '.+'
        Properties.MaxLength = 0
        Style.Font.Charset = DEFAULT_CHARSET
        Style.Font.Color = clWindowText
        Style.Font.Height = -16
        Style.Font.Name = 'Tahoma'
        Style.Font.Style = []
        Style.IsFontAssigned = True
        TabOrder = 2
        OnClick = mPANOTEClick
        Width = 121
      end
    end
    object cxDBMemo1: TcxDBMemo
      Left = 8
      Top = 48
      TabStop = False
      DataBinding.DataField = 'BPPLAT1'
      DataBinding.DataSource = DataSourceAllPoruch
      ParentFont = False
      Properties.ReadOnly = True
      Style.Color = clMoneyGreen
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -13
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.IsFontAssigned = True
      TabOrder = 10
      Height = 65
      Width = 705
    end
    object cxDBMemo3: TcxDBMemo
      Left = 8
      Top = 126
      TabStop = False
      DataBinding.DataField = 'BPNAZNACHPLAT'
      DataBinding.DataSource = DataSourceAllPoruch
      ParentFont = False
      Properties.ReadOnly = True
      Style.Color = clMoneyGreen
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -13
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.IsFontAssigned = True
      TabOrder = 11
      Height = 54
      Width = 913
    end
    object lcbPoluch: TcxDBLookupComboBox
      Left = 9
      Top = 208
      DataBinding.DataField = 'PID_POLUCH'
      DataBinding.DataSource = dsPAgr
      ParentFont = False
      Properties.DropDownListStyle = lsEditList
      Properties.DropDownRows = 15
      Properties.KeyFieldNames = 'PID'
      Properties.ListColumns = <
        item
          Caption = #1060#1048#1054
          FieldName = 'PP'
        end
        item
          Caption = #1044#1072#1090#1072' '#1088#1086#1078#1076#1077#1085#1080#1103
          Fixed = True
          FieldName = 'PDATEBIRTH'
        end
        item
          Caption = #1054#1073#1088#1072#1079#1086#1074'. '#1087#1086#1076#1088#1072#1079#1076'.'
          FieldName = 'PODR'
        end>
      Properties.ListSource = dsPoluchUslug
      Properties.MaxLength = 0
      Properties.OnEditValueChanged = lcbPoluchPropertiesEditValueChanged
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clBlack
      Style.Font.Height = -15
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.Shadow = False
      Style.IsFontAssigned = True
      TabOrder = 12
      OnClick = mPANOTEClick
      Width = 912
    end
    object eOstatok: TcxTextEdit
      Left = 177
      Top = 264
      TabStop = False
      ParentFont = False
      Properties.ReadOnly = True
      Style.Color = clMoneyGreen
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -19
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.Shadow = False
      Style.IsFontAssigned = True
      TabOrder = 13
      Width = 136
    end
    object Panel_P: TPanel
      Left = 110
      Top = 310
      Width = 913
      Height = 41
      TabOrder = 14
      DesignSize = (
        913
        41)
      object lcbPayer: TcxDBLookupComboBox
        Left = 4
        Top = 8
        DataBinding.DataField = 'PID'
        DataBinding.DataSource = dsPAgr
        ParentFont = False
        Properties.DropDownListStyle = lsEditList
        Properties.DropDownRows = 15
        Properties.KeyFieldNames = 'PID'
        Properties.ListColumns = <
          item
            Caption = #1060#1048#1054
            FieldName = 'PP'
          end
          item
            Caption = #1057#1090#1072#1090#1091#1089
            FieldName = 'SDNAME'
          end
          item
            Caption = #1044#1072#1090#1072' '#1088#1086#1078#1076'.'
            Fixed = True
            FieldName = 'PDATEBIRTH'
          end>
        Properties.ListSource = dsPeople
        Properties.MaxLength = 0
        Style.Font.Charset = DEFAULT_CHARSET
        Style.Font.Color = clBlack
        Style.Font.Height = -15
        Style.Font.Name = 'Tahoma'
        Style.Font.Style = []
        Style.Shadow = False
        Style.IsFontAssigned = True
        TabOrder = 0
        OnClick = mPANOTEClick
        Width = 799
      end
      object cxButton1: TcxButton
        Tag = 12
        Left = 806
        Top = 6
        Width = 30
        Height = 29
        Hint = #1054#1073#1085#1086#1074#1080#1090#1100' '#1076#1072#1085#1085#1099#1077
        Anchors = [akTop, akRight]
        ParentShowHint = False
        ShowHint = True
        TabOrder = 1
        TabStop = False
        OnClick = cxButton1Click
        Glyph.Data = {
          DE010000424DDE01000000000000760000002800000024000000120000000100
          0400000000006801000000000000000000001000000000000000000000000000
          8000008000000080800080000000800080008080000080808000C0C0C0000000
          FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333444444
          33333333333F7777773F33330000324334222222443333377F3733333377F333
          000032244222222222433337F7733FFFFF337F3300003222222AAAAA22243337
          F333F77777F337F30000322222A33333A2224337F33F7333337F337F00003222
          223333333A224337F33733333337F37F00003222222333333A444337FFFF7F33
          3337777300003AAAAAAA33333333333777777733333333330000333333333333
          333333333333333333FFFFFF000033333333333344444433FFFF333333777777
          00003A444333333A22222437777F333337F3333700003A2243333333A2222437
          F37F333333733337000033A224333334422224337337FFFFF7733337000033A2
          22444442222224337F3377777333FF370000333A2222222222AA243337FF3333
          33FF77F700003333AA222222AA33A3333377FFFFFF7733730000333333AAAAAA
          3333333333337777773333330000333333333333333333333333333333333333
          0000}
        LookAndFeel.SkinName = ''
        NumGlyphs = 2
      end
      object cxButton2: TcxButton
        Tag = 12
        Left = 841
        Top = 6
        Width = 30
        Height = 29
        Hint = #1044#1086#1073#1072#1074#1080#1090#1100' '#1095#1077#1083#1086#1074#1077#1082#1072
        Anchors = [akTop, akRight]
        ParentShowHint = False
        ShowHint = True
        TabOrder = 2
        TabStop = False
        OnClick = bAddManClick
        Glyph.Data = {
          76010000424D7601000000000000760000002800000020000000100000000100
          04000000000000010000CE0E0000D80E00001000000000000000000000000000
          80000080000000808000800000008000800080800000C0C0C000808080000000
          FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
          3333333333387F3333333333333333333333333333387F333333333333344333
          3333333333387F3333333333333443333333333333387F333333333333344333
          3333333333387F3333333333333443333333333333387F333333333333344333
          3333387FFFFFFFFFFFFF3344444444444433387777777F777777334444444444
          4433388888887F8888883333333443333333333333387F333333333333344333
          3333333333387F3333333333333443333333333333387F333333333333344333
          3333333333387F33333333333334433333333333333877333333333333333333
          3333333333388833333333333333333333333333333333333333}
        LookAndFeel.SkinName = ''
        NumGlyphs = 2
      end
      object cxButton4: TcxButton
        Tag = 12
        Left = 876
        Top = 6
        Width = 30
        Height = 29
        Hint = #1055#1086#1080#1089#1082' '#1087#1086#1083#1091#1095'. '#1091#1089#1083#1091#1075' '#1087#1086' '#1076#1086#1074#1077#1088#1077#1085#1085#1086#1084#1091' '#1083#1080#1094#1091
        Anchors = [akTop, akRight]
        ParentShowHint = False
        ShowHint = True
        TabOrder = 3
        TabStop = False
        OnClick = cxButton4Click
        Glyph.Data = {
          76010000424D7601000000000000760000002800000020000000100000000100
          0400000000000001000000000000000000001000000000000000000000000000
          80000080000000808000800000008000800080800000C0C0C000808080000000
          FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00777777777777
          7777777777777777777777077777777777777787777777777777700077777777
          777778887777777777770F00077777777777878887777777777770F000777777
          77777878887777777777770F00078000877777878887F888F7777770F0008888
          807777787888FFFFF87777770007777778077777888777777F877777707777FF
          F78877777877777777FF777770777777FF707777787777777778777770777777
          7F7077777877777777787777788FF777777077777FF7777777787777788FF777
          777877777FF77777777F777778087777780777777F8F77777F87777777708888
          807777777778FFFFF877777777778000877777777777F888F777}
        LookAndFeel.SkinName = ''
        NumGlyphs = 2
      end
    end
    object Panel_JL: TPanel
      Left = 110
      Top = 359
      Width = 915
      Height = 38
      TabOrder = 15
      Visible = False
      DesignSize = (
        915
        38)
      object bAddJL: TcxButton
        Tag = 12
        Left = 821
        Top = 4
        Width = 75
        Height = 29
        Hint = #1044#1086#1073#1072#1074#1080#1090#1100' '#1095#1077#1083#1086#1074#1077#1082#1072
        Anchors = [akTop, akRight]
        Caption = #1070#1088'. '#1083#1080#1094#1086
        ParentShowHint = False
        ShowHint = True
        TabOrder = 0
        TabStop = False
        OnClick = bAddJLClick
        Glyph.Data = {
          76010000424D7601000000000000760000002800000020000000100000000100
          04000000000000010000CE0E0000D80E00001000000000000000000000000000
          80000080000000808000800000008000800080800000C0C0C000808080000000
          FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
          3333333333387F3333333333333333333333333333387F333333333333344333
          3333333333387F3333333333333443333333333333387F333333333333344333
          3333333333387F3333333333333443333333333333387F333333333333344333
          3333387FFFFFFFFFFFFF3344444444444433387777777F777777334444444444
          4433388888887F8888883333333443333333333333387F333333333333344333
          3333333333387F3333333333333443333333333333387F333333333333344333
          3333333333387F33333333333334433333333333333877333333333333333333
          3333333333388833333333333333333333333333333333333333}
        LookAndFeel.SkinName = ''
        NumGlyphs = 2
      end
      object lcbJL: TcxDBLookupComboBox
        Left = 5
        Top = 6
        DataBinding.DataField = 'JLID'
        DataBinding.DataSource = dsPAgr
        ParentFont = False
        Properties.DropDownListStyle = lsEditList
        Properties.DropDownRows = 15
        Properties.KeyFieldNames = 'JLID'
        Properties.ListColumns = <
          item
            Caption = #1054#1055#1060
            Fixed = True
            MinWidth = 5
            Width = 50
            FieldName = 'JLOPF'
          end
          item
            Caption = #1053#1072#1079#1074#1072#1085#1080#1077
            Fixed = True
            Width = 400
            FieldName = 'JLEGALNAME'
          end
          item
            Caption = #1054#1043#1056#1053
            Fixed = True
            Width = 150
            FieldName = 'JLOGRN'
          end
          item
            Caption = #1048#1053#1053
            Fixed = True
            Width = 150
            FieldName = 'JLINN'
          end>
        Properties.ListFieldIndex = 1
        Properties.ListSource = dsJL
        Properties.MaxLength = 0
        Style.Font.Charset = DEFAULT_CHARSET
        Style.Font.Color = clBlack
        Style.Font.Height = -15
        Style.Font.Name = 'Tahoma'
        Style.Font.Style = []
        Style.Shadow = False
        Style.IsFontAssigned = True
        TabOrder = 1
        OnClick = mPANOTEClick
        Width = 798
      end
    end
    object cxRadioGroup1: TcxRadioGroup
      Left = 8
      Top = 316
      Properties.DefaultValue = 2
      Properties.Items = <
        item
          Caption = #1060#1080#1079'. '#1083#1080#1094#1086
          Value = 2
        end
        item
          Caption = #1070#1088'. '#1083#1080#1094#1086
          Value = 3
        end>
      Properties.ReadOnly = False
      Properties.OnEditValueChanged = cxRadioGroup1PropertiesEditValueChanged
      ItemIndex = 0
      TabOrder = 16
      Height = 57
      Width = 89
    end
  end
  object dsPeople: TDataSource
    DataSet = fdsPeople
    Left = 384
    Top = 344
  end
  object dsPAgr: TDataSource
    DataSet = fdsPaymantAgr
    Left = 384
    Top = 5
  end
  object fdsPaymantAgr: TpFIBDataSet
    CachedUpdates = True
    UpdateSQL.Strings = (
      'UPDATE PAYMANTS_AGR'
      'SET '
      '    AGRID = :AGRID,'
      '    PID_POLUCH = :PID_POLUCH,'
      '    PAFORM = :PAFORM,'
      '    PAAMOUNT = :PAAMOUNT,'
      '    PABANKPERCENTS = :PABANKPERCENTS,'
      '    PAAMOUNTBALANCE = :PAAMOUNTBALANCE,'
      '    PADATE = :PADATE,'
      '    PID = :PID,'
      '    PANOTE = :PANOTE,'
      '    PAISDELETE = :PAISDELETE,'
      '    PANUMUSER = :PANUMUSER,'
      '    JLID = :JLID,'
      '    PAUSERMONEY = :PAUSERMONEY,'
      '    BPID = :BPID,'
      '    RPID = :RPID,'
      '    CSID = :CSID'
      'WHERE'
      '    PAID = :OLD_PAID'
      '    ')
    DeleteSQL.Strings = (
      'DELETE FROM'
      '    PAYMANTS_AGR'
      'WHERE'
      '        PAID = :OLD_PAID'
      '    ')
    InsertSQL.Strings = (
      'INSERT INTO PAYMANTS_AGR('
      '    PAID,'
      '    AGRID,'
      '    PID_POLUCH,'
      '    PAFORM,'
      '    PAAMOUNT,'
      '    PABANKPERCENTS,'
      '    PAAMOUNTBALANCE,'
      '    PADATE,'
      '    PID,'
      '    PANOTE,'
      '    PAISDELETE,'
      '    PANUMUSER,'
      '    JLID,'
      '    PAUSERMONEY,'
      '    BPID,'
      '    RPID,'
      '    CSID'
      ')'
      'VALUES('
      '    :PAID,'
      '    :AGRID,'
      '    :PID_POLUCH,'
      '    :PAFORM,'
      '    :PAAMOUNT,'
      '    :PABANKPERCENTS,'
      '    :PAAMOUNTBALANCE,'
      '    :PADATE,'
      '    :PID,'
      '    :PANOTE,'
      '    :PAISDELETE,'
      '    :PANUMUSER,'
      '    :JLID,'
      '    :PAUSERMONEY,'
      '    :BPID,'
      '    :RPID,'
      '    :CSID'
      ')')
    RefreshSQL.Strings = (
      'select * from paymants_agr pa'
      'where(  pa.paid = :paid'
      'and pa.paisdelete is null'
      '     ) and (     PA.PAID = :OLD_PAID'
      '     )'
      '    ')
    SelectSQL.Strings = (
      'select * from paymants_agr pa'
      'where pa.paid = :paid'
      'and pa.paisdelete is null')
    AutoUpdateOptions.UpdateTableName = 'PAYMANTS_AGR'
    AutoUpdateOptions.KeyFields = 'PAID'
    AutoUpdateOptions.AutoReWriteSqls = True
    AutoUpdateOptions.CanChangeSQLs = True
    AutoUpdateOptions.GeneratorName = 'GEN_PAYMANTS_AGR_ID'
    AutoUpdateOptions.UpdateOnlyModifiedFields = True
    AutoUpdateOptions.WhenGetGenID = wgOnNewRecord
    AutoUpdateOptions.SeparateBlobUpdate = True
    AfterInsert = fdsPaymantAgrAfterInsert
    Transaction = DMInv.trFibRead
    Database = DMInv.db
    UpdateTransaction = DMInv.trFibWrite
    Left = 416
    Top = 5
    oStartTransaction = False
    object fdsPaymantAgrPAID: TFIBIntegerField
      FieldName = 'PAID'
      Origin = 'PAYMANTS_AGR.PAID'
    end
    object fdsPaymantAgrAGRID: TFIBIntegerField
      FieldName = 'AGRID'
      Origin = 'PAYMANTS_AGR.AGRID'
    end
    object fdsPaymantAgrPID_POLUCH: TFIBIntegerField
      FieldName = 'PID_POLUCH'
      Origin = 'PAYMANTS_AGR.PID_POLUCH'
    end
    object fdsPaymantAgrPAFORM: TFIBIntegerField
      FieldName = 'PAFORM'
      Origin = 'PAYMANTS_AGR.PAFORM'
    end
    object fdsPaymantAgrPAAMOUNT: TFIBBCDField
      FieldName = 'PAAMOUNT'
      Origin = 'PAYMANTS_AGR.PAAMOUNT'
      Size = 2
      RoundByScale = True
    end
    object fdsPaymantAgrPABANKPERCENTS: TFIBBCDField
      FieldName = 'PABANKPERCENTS'
      Origin = 'PAYMANTS_AGR.PABANKPERCENTS'
      Size = 2
      RoundByScale = True
    end
    object fdsPaymantAgrPAAMOUNTBALANCE: TFIBBCDField
      FieldName = 'PAAMOUNTBALANCE'
      Origin = 'PAYMANTS_AGR.PAAMOUNTBALANCE'
      Size = 2
      RoundByScale = True
    end
    object fdsPaymantAgrPADATE: TFIBDateField
      FieldName = 'PADATE'
      Origin = 'PAYMANTS_AGR.PADATE'
    end
    object fdsPaymantAgrPID: TFIBIntegerField
      FieldName = 'PID'
      Origin = 'PAYMANTS_AGR.PID'
    end
    object fdsPaymantAgrPANOTE: TFIBStringField
      FieldName = 'PANOTE'
      Origin = 'PAYMANTS_AGR.PANOTE'
      Size = 255
      EmptyStrToNull = True
    end
    object fdsPaymantAgrPAUSERENTER: TFIBStringField
      FieldName = 'PAUSERENTER'
      Origin = 'PAYMANTS_AGR.PAUSERENTER'
      Size = 40
      EmptyStrToNull = True
    end
    object fdsPaymantAgrPATIMEENTER: TFIBDateTimeField
      FieldName = 'PATIMEENTER'
      Origin = 'PAYMANTS_AGR.PATIMEENTER'
    end
    object fdsPaymantAgrPAUSEREDIT: TFIBStringField
      FieldName = 'PAUSEREDIT'
      Origin = 'PAYMANTS_AGR.PAUSEREDIT'
      Size = 40
      EmptyStrToNull = True
    end
    object fdsPaymantAgrPATIMEEDIT: TFIBDateTimeField
      FieldName = 'PATIMEEDIT'
      Origin = 'PAYMANTS_AGR.PATIMEEDIT'
    end
    object fdsPaymantAgrPAISDELETE: TFIBIntegerField
      FieldName = 'PAISDELETE'
      Origin = 'PAYMANTS_AGR.PAISDELETE'
    end
    object fdsPaymantAgrPANUMUSER: TFIBIntegerField
      FieldName = 'PANUMUSER'
      Origin = 'PAYMANTS_AGR.PANUMUSER'
    end
    object fdsPaymantAgrJLID: TFIBIntegerField
      FieldName = 'JLID'
      Origin = 'PAYMANTS_AGR.JLID'
    end
    object fdsPaymantAgrPAUSERMONEY: TFIBIntegerField
      FieldName = 'PAUSERMONEY'
      Origin = 'PAYMANTS_AGR.PAUSERMONEY'
    end
    object fdsPaymantAgrBPID: TFIBIntegerField
      FieldName = 'BPID'
      Origin = 'PAYMANTS_AGR.BPID'
    end
    object fdsPaymantAgrRPID: TFIBIntegerField
      FieldName = 'RPID'
      Origin = 'PAYMANTS_AGR.RPID'
    end
    object fdsPaymantAgrCSID: TFIBIntegerField
      FieldName = 'CSID'
      Origin = 'PAYMANTS_AGR.CSID'
    end
  end
  object dsAgr: TDataSource
    DataSet = fdsAgr
    Left = 112
    Top = 456
  end
  object fdsAgr: TpFIBDataSet
    SelectSQL.Strings = (
      
        'SELECT A.AGID, A.AGDATEBEGIN, A.AGDATEEND, CAST(A.AGTIMEENTER AS' +
        ' DATE) AS data_podp,'
      'CASE a.AGPODRTYPE'
      'WHEN 0 THEN '#39#1044'/'#1089#39
      'WHEN 1 THEN '#39#1043#1080#1084#1085#1072#1079'.'#39
      'WHEN 2 THEN '#39#1057#1088'. '#1096#1082'.'#39
      'WHEN 3 THEN '#39#1057#1090'. '#1096#1082'.'#39
      'WHEN 4 THEN '#39#1051#1072#1075#1077#1088#1100#39
      'END AS podrazd,'
      
        '(P_res.PLASTNAME||'#39' '#39'||P_res.PNAME||'#39' '#39'||COALESCE(P_res.PPATRONY' +
        'MIC,'#39' '#39')) AS P_RECIPIENT,'
      
        ' CAST( trim(LIST((P.PLASTNAME||'#39' '#39'||P.PNAME||'#39' '#39'||COALESCE(P.PPA' +
        'TRONYMIC,'#39' '#39')), '#39', '#39')) AS VARCHAR(500)) AS podp'
      'FROM AGREEMENTS A'
      'LEFT OUTER JOIN AGR_POLUCH_USLUG APU ON apu.AGID = A.AGID'
      'LEFT OUTER JOIN PEOPLE P_res ON P_res.PID = APU.PID '
      'LEFT OUTER JOIN AGR_PODPISANT AP ON AP.AGID = A.AGID'
      'LEFT OUTER JOIN PEOPLE P ON P.PID = AP.PID'
      'WHERE A.AGISDELETE IS NULL'
      'AND APU.PID = :PID'
      'AND AP.POTYPE = 0'
      'GROUP BY 1,2,3,4,5,6'
      'UNION'
      
        'SELECT A.AGID, A.AGDATEBEGIN, A.AGDATEEND, CAST(A.AGTIMEENTER AS' +
        ' DATE) AS data_podp,'
      'CASE a.AGPODRTYPE'
      'WHEN 0 THEN '#39#1044'/'#1089#39
      'WHEN 1 THEN '#39#1043#1080#1084#1085#1072#1079'.'#39
      'WHEN 2 THEN '#39#1057#1088'. '#1096#1082'.'#39
      'WHEN 3 THEN '#39#1057#1090'. '#1096#1082'.'#39
      'WHEN 4 THEN '#39#1051#1072#1075#1077#1088#1100#39
      'END AS podrazd,'
      
        '(P_res.PLASTNAME||'#39' '#39'||P_res.PNAME||'#39' '#39'||COALESCE(P_res.PPATRONY' +
        'MIC,'#39' '#39')) AS P_RECIPIENT,'
      
        ' CAST( trim(LIST(COALESCE(sd.SDNAME, jl.JLOPF)||'#39' "'#39'||jl.JLEGALN' +
        'AME||'#39'" '#39', '#39', '#39')) AS VARCHAR(500)) AS podp'
      'FROM AGREEMENTS A'
      'LEFT OUTER JOIN AGR_POLUCH_USLUG APU ON apu.AGID = A.AGID'
      'LEFT OUTER JOIN PEOPLE P_res ON P_res.PID = APU.PID '
      'LEFT OUTER JOIN AGR_PODPISANT AP ON AP.AGID = A.AGID'
      'LEFT OUTER JOIN JURLITSA jl ON jl.JLID = ap.ID_JURIDICAL_FACE'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = jl.JLOPFSDID'
      'WHERE A.AGISDELETE IS NULL'
      'AND APU.PID = :PID'
      'AND AP.POTYPE = 1'
      'GROUP BY 1,2,3,4,5,6'
      'union'
      
        'SELECT null as AGID, null as AGDATEBEGIN, null as AGDATEEND, nul' +
        'l as data_podp,'
      'null as podrazd, null AS P_RECIPIENT, null as podp '
      'from rdb$database'
      'order by 1')
    Transaction = DMInv.trFibRead
    Database = DMInv.db
    Left = 144
    Top = 456
    object fdsAgrAGID: TFIBIntegerField
      FieldName = 'AGID'
      Origin = 'AGREEMENTS.AGID'
    end
    object fdsAgrAGDATEBEGIN: TFIBDateField
      FieldName = 'AGDATEBEGIN'
      Origin = 'AGREEMENTS.AGDATEBEGIN'
    end
    object fdsAgrAGDATEEND: TFIBDateField
      FieldName = 'AGDATEEND'
      Origin = 'AGREEMENTS.AGDATEEND'
    end
    object fdsAgrDATA_PODP: TFIBDateField
      FieldName = 'DATA_PODP'
    end
    object fdsAgrPODRAZD: TFIBStringField
      FieldName = 'PODRAZD'
      Size = 7
      EmptyStrToNull = True
    end
    object fdsAgrP_RECIPIENT: TFIBStringField
      FieldName = 'P_RECIPIENT'
      Size = 767
      EmptyStrToNull = True
    end
    object fdsAgrPODP: TFIBStringField
      FieldName = 'PODP'
      Size = 500
      EmptyStrToNull = True
    end
  end
  object fdsPeople: TpFIBDataSet
    SelectSQL.Strings = (
      'select P.PID,'
      
        '       (coalesce(P.PLASTNAME, '#39' '#39') || '#39' '#39' || coalesce(P.PNAME, '#39 +
        ' '#39') || '#39' '#39' || coalesce(P.PPATRONYMIC, '#39' '#39')) as PP,'
      
        '        IIF(PS.SDID IN (1246,1248), SD.SDNAME, COALESCE(dol.sdna' +
        'me, '#39#1042#1080#1079#1080#1090#1077#1088#39') ) AS SDNAME,'
      '        p.PDATEBIRTH'
      'from PEOPLE P'
      'left outer join P_STATUS PS on PS.PID = P.PID'
      'left outer join SYS_DIC SD on SD.SDID = PS.SDID'
      'LEFT OUTER JOIN'
      '('
      'SELECT d.PID, sd.SDNAME'
      'FROM DOLJNOST_PEOPLE d'
      'INNER JOIN DOLJNOST D1 ON d1.DOLID = d.DOLID'
      'INNER JOIN SYS_DIC SD ON SD.SDID = d1.SDID'
      'WHERE d.DOLISDELETE IS NULL'
      
        'AND CURRENT_DATE BETWEEN D.DOLDATEBEGIN AND COALESCE(d.DOLDATEEN' +
        'D, CURRENT_DATE)'
      ') AS dol ON DOL.pid = p.pid'
      'where P.PISDELETE is null')
    Transaction = DMInv.trFibRead
    Database = DMInv.db
    Left = 416
    Top = 344
    object fdsPeoplePID: TFIBIntegerField
      FieldName = 'PID'
      Origin = 'PEOPLE.PID'
    end
    object fdsPeoplePP: TFIBStringField
      FieldName = 'PP'
      Size = 767
      EmptyStrToNull = True
    end
    object fdsPeopleSDNAME: TFIBStringField
      FieldName = 'SDNAME'
      Size = 255
      EmptyStrToNull = True
    end
    object fdsPeoplePDATEBIRTH: TFIBDateField
      FieldName = 'PDATEBIRTH'
      Origin = 'PEOPLE.PDATEBIRTH'
    end
  end
  object fqBalance: TpFIBQuery
    Transaction = DMInv.trFibRead
    Database = DMInv.db
    SQL.Strings = (
      'SELECT COALESCE(t.BALANCE, 0) + cast(:param as'
      ' d_float) AS balance'
      'FROM P_BALANCE_AGR t'
      'WHERE t.PID = :pid')
    Left = 984
    Top = 77
  end
  object fqLockPaymants_Agr: TpFIBQuery
    Transaction = DMInv.trFibWrite
    Database = DMInv.db
    SQL.Strings = (
      'select * from paymants_agr pa'
      'where pa.paid = :paid'
      'and pa.paisdelete is null'
      'for update with lock')
    Left = 464
    Top = 8
  end
  object fqAgrFind: TpFIBQuery
    Transaction = DMInv.trFibRead
    Database = DMInv.db
    SQL.Strings = (
      'SELECT A.AGID,'
      
        'CAST(LIST('#39#1055#1086#1083#1091#1095'. - '#39'||(P_res.PLASTNAME||'#39' '#39'||P_res.PNAME||'#39' '#39'||' +
        'COALESCE(P_res.PPATRONYMIC,'#39' '#39'))||'#39', '#39'||'
      
        '  '#39' '#1055#1086#1076#1087#1080#1089#1072#1085#1090' - '#39'||(P.PLASTNAME||'#39' '#39'||P.PNAME||'#39' '#39'||COALESCE(P.P' +
        'PATRONYMIC,'#39' '#39')), '#39', '#39') AS VARCHAR(500)) AS spisok'
      'FROM AGREEMENTS A'
      'LEFT OUTER JOIN AGR_POLUCH_USLUG APU ON apu.AGID = A.AGID'
      'LEFT OUTER JOIN PEOPLE P_res ON P_res.PID = APU.PID '
      'LEFT OUTER JOIN AGR_PODPISANT AP ON AP.AGID = A.AGID'
      'LEFT OUTER JOIN PEOPLE P ON P.PID = AP.PID'
      'WHERE A.AGISDELETE IS NULL'
      'AND AP.POTYPE = 0'
      'AND A.AGID IS NOT NULL'
      '@@where_clause@'
      'GROUP BY 1'
      'UNION'
      
        'SELECT A.AGID, cast(LIST('#39#1055#1086#1083#1091#1095'. - '#39'||(P_res.PLASTNAME||'#39' '#39'||P_r' +
        'es.PNAME||'#39' '#39'||COALESCE(P_res.PPATRONYMIC,'#39' '#39'))||'#39', '#39'||'
      
        '  '#39' '#1055#1086#1076#1087#1080#1089#1072#1085#1090' - '#39'||COALESCE(jl.JLOPF, sd.SDNAME)||'#39' "'#39'||jl.JLEGA' +
        'LNAME||'#39'" '#39', '#39', '#39') AS VARCHAR(500) ) AS spisok'
      'FROM AGREEMENTS A'
      'LEFT OUTER JOIN AGR_POLUCH_USLUG APU ON apu.AGID = A.AGID'
      'LEFT OUTER JOIN PEOPLE P_res ON P_res.PID = APU.PID '
      'LEFT OUTER JOIN AGR_PODPISANT AP ON AP.AGID = A.AGID'
      'LEFT OUTER JOIN JURLITSA jl ON jl.JLID = ap.ID_JURIDICAL_FACE'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = jl.JLOPFSDID'
      'WHERE A.AGISDELETE IS NULL'
      'AND AP.POTYPE = 1'
      'AND A.AGID IS NOT NULL'
      '@@where_clause@'
      'GROUP BY 1')
    Left = 1016
    Top = 157
    qoStartTransaction = True
  end
  object DataSourceAllPoruch: TDataSource
    Left = 296
  end
  object dsPoluchUslug: TDataSource
    DataSet = qPoluchUslug
    Left = 272
    Top = 208
  end
  object qPoluchUslug: TpFIBDataSet
    SelectSQL.Strings = (
      
        'SELECT P.PID, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,' +
        #39' '#39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    SD.SDNAME, sd1.SDNAME AS podr, P.PDATEBIRTH'
      'FROM PEOPLE P'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN ('
      ' SELECT APU.PID, dp.sdid, dp.DPDATEIN, dp.DPDATEOUT, sd.SDNAME'
      'FROM DETI_PODRAZD_SC DP'
      'INNER JOIN SPEC_COND SC ON SC.SCID = DP.SCID'
      'INNER JOIN AGR_POLUCH_USLUG APU ON APU.AGID = SC.AGID'
      'INNER JOIN SYS_DIC SD ON SD.SDID = DP.SDID'
      ' where DP.DPTYPE = 1 AND SC.SCISDELETE IS NULL'
      ' and  CURRENT_DATE BETWEEN CAST(dp.DPDATEIN AS DATE)'
      
        ' AND COALESCE(CAST(dp.DPDATEOUT AS DATE), CURRENT_DATE)) dp1 on ' +
        'dp1.pid = p.PID'
      'LEFT OUTER JOIN SYS_DIC SD1 ON SD1.SDID = DP1.SDID'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = PS.SDID'
      'WHERE P.PISDELETE IS NULL'
      '    AND PS.SDID = 1246'
      'UNION'
      
        'SELECT  CAST('#39'-1'#39' AS INTEGER) AS PID, '#39'---- '#1053#1080#1082#1090#1086' '#1085#1077' '#1074#1099#1073#1088#1072#1085' ----' +
        ' '#39' AS PP,'
      '    '#39' '#39' AS  SDNAME, '#39' '#39' AS podr, NULL AS PDATEBIRTH'
      'FROM rdb$database'
      'ORDER BY 2')
    Transaction = DMInv.trFibRead
    Database = DMInv.db
    Left = 304
    Top = 209
    object qPoluchUslugPID: TFIBIntegerField
      FieldName = 'PID'
    end
    object qPoluchUslugPP: TFIBStringField
      FieldName = 'PP'
      Size = 767
      EmptyStrToNull = True
    end
    object qPoluchUslugSDNAME: TFIBStringField
      FieldName = 'SDNAME'
      Size = 255
      EmptyStrToNull = True
    end
    object qPoluchUslugPODR: TFIBStringField
      FieldName = 'PODR'
      Size = 255
      EmptyStrToNull = True
    end
    object qPoluchUslugPDATEBIRTH: TFIBDateField
      FieldName = 'PDATEBIRTH'
    end
  end
  object qDolg: TpFIBQuery
    Transaction = DMInv.trFibWrite
    Database = DMInv.db
    SQL.Strings = (
      'EXECUTE PROCEDURE SP_BALANCE (:PID)')
    Left = 824
    Top = 5
  end
  object fdsJL: TpFIBDataSet
    SelectSQL.Strings = (
      
        'SELECT J.JLID, j.JLEGALNAME, COALESCE(j.JLOPF, sd.SDNAME) AS jlo' +
        'pf, j.JLINN,'
      'j.JLOGRN'
      'FROM JURLITSA J'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = j.JLOPFSDID'
      'where J.JLISDELETE is null')
    Transaction = DMInv.trFibRead
    Database = DMInv.db
    Left = 416
    Top = 416
    object fdsJLJLID: TFIBIntegerField
      FieldName = 'JLID'
    end
    object fdsJLJLEGALNAME: TFIBStringField
      FieldName = 'JLEGALNAME'
      Size = 255
      EmptyStrToNull = True
    end
    object fdsJLJLOPF: TFIBStringField
      FieldName = 'JLOPF'
      Size = 255
      EmptyStrToNull = True
    end
    object fdsJLJLINN: TFIBStringField
      FieldName = 'JLINN'
      Size = 12
      EmptyStrToNull = True
    end
    object fdsJLJLOGRN: TFIBStringField
      FieldName = 'JLOGRN'
      Size = 255
      EmptyStrToNull = True
    end
  end
  object dsJL: TDataSource
    DataSet = fdsJL
    Left = 384
    Top = 416
  end
  object fqFindPU: TpFIBQuery
    Transaction = DMInv.trFibRead
    Database = DMInv.db
    SQL.Strings = (
      
        'SELECT LIST( (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39 +
        ' '#39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39'))||'#39'('#39'||COALESCE(sd1.sdname' +
        ','#39#1089#1077#1081#1095#1072#1089' '#1085#1077' '#1074' '#1087#1086#1076#1088#1072#1079#1076#1077#1083#1077#1085#1080#1080#39')||'#39')'#39', '#39';'#39') AS pu'
      'FROM P_REL PR'
      'INNER JOIN PEOPLE P ON P.PID = PR.PID'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN ('
      ' SELECT APU.PID, dp.sdid, dp.DPDATEIN, dp.DPDATEOUT, sd.SDNAME'
      'FROM DETI_PODRAZD_SC DP'
      'INNER JOIN SPEC_COND SC ON SC.SCID = DP.SCID'
      'INNER JOIN AGR_POLUCH_USLUG APU ON APU.AGID = SC.AGID'
      'INNER JOIN SYS_DIC SD ON SD.SDID = DP.SDID'
      ' where DP.DPTYPE = 1 AND SC.SCISDELETE IS NULL'
      ' and  CURRENT_DATE BETWEEN CAST(dp.DPDATEIN AS DATE)'
      
        ' AND COALESCE(CAST(dp.DPDATEOUT AS DATE), CURRENT_DATE)) dp1 on ' +
        'dp1.pid = p.PID'
      'LEFT OUTER JOIN SYS_DIC SD1 ON SD1.SDID = DP1.SDID'
      'WHERE'
      'PR.PID_GROUP = ('
      'SELECT DISTINCT PR1.PID_GROUP'
      'FROM P_REL PR1'
      'WHERE PR1.PID = :PID'
      ')'
      'and P.PISDELETE IS NULL AND PS.SDID = 1246')
    Left = 1031
    Top = 361
    qoStartTransaction = True
  end
end
